using OneCaps.Core.Entity;
using OneCaps.Core.Enum;
using OneCaps.Core.Models;

namespace OneCaps.Core.Interfaces
{
    /// <summary>
    /// 停车服务接口
    /// </summary>
    public interface IParkingService
    {
        /// <summary>
        /// 车辆入场
        /// </summary>
        Task<ParkingRecord> VehicleEntryAsync(string licensePlate, VehicleType vehicleType, string? entryGateNumber = null, string? entryOperator = null);

        /// <summary>
        /// 车辆出场
        /// </summary>
        Task<ParkingRecord> VehicleExitAsync(string licensePlate, string? exitGateNumber = null, string? exitOperator = null);

        /// <summary>
        /// 获取车辆当前停车记录
        /// </summary>
        Task<ParkingRecord?> GetCurrentParkingRecordAsync(string licensePlate);

        /// <summary>
        /// 获取场内所有车辆
        /// </summary>
        Task<IEnumerable<ParkingRecord>> GetParkingVehiclesAsync();

        /// <summary>
        /// 分配车位
        /// </summary>
        Task<ParkingSpace> AssignParkingSpaceAsync(VehicleType vehicleType, bool isVip = false);

        /// <summary>
        /// 释放车位
        /// </summary>
        Task ReleaseParkingSpaceAsync(int parkingSpaceId);

        /// <summary>
        /// 获取可用车位数量
        /// </summary>
        Task<int> GetAvailableSpacesCountAsync(VehicleType vehicleType);

        /// <summary>
        /// 获取车位状态
        /// </summary>
        Task<ParkingSpaceStatus> GetParkingSpaceStatusAsync(int parkingSpaceId);

        /// <summary>
        /// 设置车位维护状态
        /// </summary>
        Task SetParkingSpaceMaintenanceAsync(int parkingSpaceId);

        /// <summary>
        /// 取消车位维护状态
        /// </summary>
        Task CancelParkingSpaceMaintenanceAsync(int parkingSpaceId);

        /// <summary>
        /// 车牌识别
        /// </summary>
        Task<string> RecognizeLicensePlateAsync(byte[] imageData);

        /// <summary>
        /// 验证车牌号格式
        /// </summary>
        bool ValidateLicensePlate(string licensePlate);

        /// <summary>
        /// 获取停车时长
        /// </summary>
        TimeSpan GetParkingDuration(int parkingRecordId);

        /// <summary>
        /// 检查车辆是否在停车场内
        /// </summary>
        Task<bool> IsVehicleParkingAsync(string licensePlate);

        /// <summary>
        /// 获取车辆停车历史
        /// </summary>
        Task<IEnumerable<ParkingRecord>> GetVehicleParkingHistoryAsync(string licensePlate, DateTime? startDate = null, DateTime? endDate = null);
    }
} 